-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove bounds from PrevalidateAttests
struct definition
#2886
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
PrevalidateAttests
Send
+ Sync
and remove boundsPrevalidateAttests
struct definition
pub struct PrevalidateAttests<T: Config + Send + Sync>(sp_std::marker::PhantomData<T>) | ||
where | ||
<T as frame_system::Config>::RuntimeCall: IsSubType<Call<T>>; | ||
pub struct PrevalidateAttests<T>(core::marker::PhantomData<fn(T)>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we really need this :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYM? The PhantomData<fn(T)>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if i use PhantomData<T>
then its not Send + Sync
and if i remove the PD then it errors parameter T is never used
.
Signed Extension does require it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it needs to be Send and Sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -620,7 +618,7 @@ where | |||
} | |||
} | |||
|
|||
impl<T: Config + Send + Sync> SignedExtension for PrevalidateAttests<T> | |||
impl<T: Config> SignedExtension for PrevalidateAttests<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you would just kept the bounds here, it would have been enough.
But we can go with the phantomdata trick.
Co-authored-by: Bastian Köcher <git@kchr.de>
Removing some bounds as it came up in #2726 while still keeping
Send + Sync
capabilities.